﻿using PostSharp.Extensibility;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace JGSY.SerialCommunication.UpperComputer.Core.AOP.Decorator
{
    /// <summary>
    /// 抽象装饰器
    /// </summary>
    public abstract class AbstractServiceDecorator : IService
    {
        protected readonly IService _service; // 持有被装饰对象的引用

        public AbstractServiceDecorator(IService service)
        {
            _service = service; // 保存引用，而非替换 多个调用就形成一层包裹一层
        }

        public virtual void Execute()
        {
            _service.Execute();
        }
    }






}
